typedef struct {
    int StackIn[100];
    int StackOut[100];
    int topIn;
    int topOut;
} MyQueue;


MyQueue* myQueueCreate() {
    MyQueue* obj = (MyQueue*)malloc(sizeof(MyQueue));
    obj->topIn = 0;
    obj->topOut = 0;
    return obj;
}

void myQueuePush(MyQueue* obj, int x) {
    obj->StackIn[obj->topIn] = x;
    obj->topIn++;
}

int myQueuePop(MyQueue* obj) {
    if (obj->topOut == 0)
    {
        while (obj->topIn > 0)
            obj->StackOut[(obj->topOut)++] = obj->StackIn[--(obj->topIn)];
    }
    return obj->StackOut[--(obj->topOut)];
}

int myQueuePeek(MyQueue* obj) {
    if (obj->topOut == 0)
    {
        while (obj->topIn > 0)
            obj->StackOut[(obj->topOut)++] = obj->StackIn[--(obj->topIn)];
    }
    return obj->StackOut[(obj->topOut) - 1];
}

bool myQueueEmpty(MyQueue* obj) {
    if (obj->topOut == 0)
    {
        while (obj->topIn > 0)
            obj->StackOut[(obj->topOut)++] = obj->StackIn[--(obj->topIn)];
    }
    if (obj->topOut == 0)
        return true;
    else
        return false;
}

void myQueueFree(MyQueue* obj) {
    free(obj);
}

/**
 * Your MyQueue struct will be instantiated and called as such:
 * MyQueue* obj = myQueueCreate();
 * myQueuePush(obj, x);

 * int param_2 = myQueuePop(obj);

 * int param_3 = myQueuePeek(obj);

 * bool param_4 = myQueueEmpty(obj);

 * myQueueFree(obj);
*/